﻿#include<iostream>
using namespace std;

struct Role {
	int Hp;
	int Mp;
	int damage;
};

int Add(int* x, int* y);

bool Act(const Role* Acter, Role* beActer);

int main() {
	int x = 2, y = 1;
	int c = Add(&x, &y);
	cout << "c=" << c << "x=" << x << "y=" << y << endl;

	Role User{ 1000,1500,5001231 };
	Role Monster{ 1500,100,100 };

	if (Act(&Monster, &User))cout << "角色死亡！" << endl;
	if (Act(&User, &Monster))cout << "怪物死亡！" << endl;
}
int Add(int* x, int* y) {
	(*x) *= 100;
	(*y) *= 10;
	return (*x) + (*y);
}


bool Act(const Role* Acter, Role* beActer) {
	beActer->Hp -= Acter->damage;
	return beActer->Hp <= 0;
}
